import request from "./request"
import qs from "qs"

export let jingpinApi = () => request.get("/products/recommend")
// 热门
export let HotApi = () => request.get("/products/hot")

// 定义一个发送验证码
export const SendSmSAPI = (params) => request.post("/sendSMS",
    qs.stringify(params))
// 登录请求
export const phoneReginAPI = (params) => request.post("/phoneRegin",
    qs.stringify(params))
// 微信登录
export const weiXinLoginAPI = (params) => request.post("/wechatUsers/PCLogin",
    qs.stringify(params))
// 绑定微信
export const bindingAPI = (params) => request.post("/wechatUsers/binding",
    qs.stringify(params))
//  获取用户信息
export let UserProfilesApi = () => request.get("/shop/userProfiles")

export let GoodsDetailsApi = (id) => request.get(`/products/${id}`)

// 加入购物车
export const addTocartAPI = (params) => request.post("/shop/carts/add",
    qs.stringify(params))
// 请求全部商品
export let GoodsSearchApi = (params) => request.get("/products", { params })
// 查看购物车
export let shopCartsApi = () => request.get("/shop/carts")
// 删除购物车内容 
export let productIdsApi = (id) => request.delete(`/shop/carts?productIds=${id}`)